package Servlets;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/CourseCreatorServlet")
public class CourseCreatorServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
	{

	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
	{	
		String cName = request.getParameter("courseName");
		String cSec = request.getParameter("courseSection");
		String cTime = request.getParameter("courseTimings");
		String cLoc = request.getParameter("courseLocation");
		
		System.out.println("New Course->"+cName+" | "+cSec+" | "+cTime+" | "+cLoc);
		
		RequestDispatcher rd=getServletContext().getRequestDispatcher("/View/newCourse.jsp");
		rd.forward(request, response);
	}

}
